package com.zhang.edu.realtime.publish.service.impl;

import com.zhang.edu.realtime.publish.bean.TradeProvinceOrderAmount;
import com.zhang.edu.realtime.publish.bean.TradeProvinceOrderCount;
import com.zhang.edu.realtime.publish.bean.TradeProvinceOrderUuCount;
import com.zhang.edu.realtime.publish.bean.TradeSourceStats;
import com.zhang.edu.realtime.publish.mapper.TradeStatsMapper;
import com.zhang.edu.realtime.publish.service.TradeStatsService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.math.BigDecimal;
import java.util.List;

@Service
public class TradeStatsServiceImpl  implements TradeStatsService {

    @Resource
    private TradeStatsMapper tradeStatsMapper;

    @Override
    public List<TradeSourceStats> getTradeSourceStats(Integer date) {
        return tradeStatsMapper.selectTradeSourceStats(date);
    }

    @Override
    public List<TradeProvinceOrderAmount> getTradeProvinceOrderAmount(Integer date) {
        return tradeStatsMapper.selectTradeProvinceOrderAmount(date);
    }

    @Override
    public List<TradeProvinceOrderUuCount> getTradeProvinceOrderUuCount(Integer date) {
        return tradeStatsMapper.selectTradeProvinceOrderUuCount(date);
    }

    @Override
    public List<TradeProvinceOrderCount> getTradeProvinceOrderCount(Integer date) {
        return tradeStatsMapper.selectTradeProvinceOrderCount(date);
    }

    @Override
    public BigDecimal getOrderTotalAmount(Integer date) {
        return tradeStatsMapper.selectOrderTotalAmount(date);
    }

    @Override
    public Long getOrderTotalCount(Integer date) {
        return tradeStatsMapper.selectOrderTotalCt(date);
    }
}
